package com.rabbit.eap.controller.monitor;

import com.rabbit.eap.framework.common.api.ApiResult;
import com.rabbit.eap.framework.common.controller.BaseController;
import com.rabbit.eap.framework.common.domain.Server;
import com.rabbit.eap.framework.log.annotation.Module;
import com.rabbit.eap.framework.log.annotation.OperationLog;
import com.rabbit.eap.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @projectName eap
 * @packageName com.rabbit.eap.controller.monitor
 * @className ServerController
 * @author： rabbit
 * @version： 1.0
 * @since： 2020/6/2 18:56
 * <p>Description: ServerController
 * 服务器监控
 * </p>

 */
@Slf4j
@RestController
@RequestMapping("/monitor/server")
@Module("monitor")
@Api(value = "服务监控api", tags = {"服务监控信息"})
public class ServerController extends BaseController {
    @RequiresPermissions("monitor:server:list")
    @GetMapping("/getInfo")
    @OperationLog(name = "服务监控", type = OperationLogType.query)
    @ApiOperation(value = "服务监控", response = ApiResult.class)
    public ApiResult getInfo() throws Exception
    {
        Server server = new Server();
        server.copyTo();
        return ApiResult.ok(server);
    }
}
